package com.example.calendarapp;

import android.util.Log;

/**
 * data holder class for event category, each property has getter and setter
 * @author nathan
 *
 */

public class EventCategory {

	private String name;
	private int color;
	private int id;
	private int position;
	
	
	public EventCategory(String n, int c, int i)
	{
		this.name = n;
		this.color = c;
		this.id = i;
		
	}
	
	public void setName(String n)
	{
		this.name = n;
	}
	
	public String getName()
	{
		return name;
	}
	
	public void setColor(int c)
	{
		this.color = c;
	}

	public int getColor()
	{
		return color;
	}
	
	@Override
	public String toString()
	{
		return name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	public int getColorCode()
	{
		int colorCode = android.R.color.black;
		switch(this.color)
		{
			case 0:
				colorCode = android.R.color.black;
				break;
			case 1:
				colorCode = android.R.color.holo_blue_bright;
				break;
			case 2:
				colorCode = android.R.color.holo_green_light;
				break;
			case 3:
				colorCode = android.R.color.holo_orange_light;
				break;
			case 4:
				colorCode = android.R.color.holo_purple;
				break;
			case 5:
				colorCode = android.R.color.holo_red_light;				
				break;
		}
		return colorCode;
	}

	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}
}
